﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace EdgeStatz.DesignTools
{
    public partial class CompileParams : Form
    {
        string param;

        public string Parameter
        {
            get { return param; }
            set { param = value; }
        }

        /// <summary>
        /// New Compile Parameter
        /// </summary>
        public CompileParams()
        {
            InitializeComponent();
        }

        public CompileParams(string param): this()
        { this.param = param; tb_Parameter.Text = param; }

        private void b_OK_Click(object sender, EventArgs e)
        {
            if (!tb_Parameter.Text.Trim().Equals(""))
            {
                param = tb_Parameter.Text;
                this.DialogResult = DialogResult.OK;
                this.Close();
            }
            else
            {
                MessageBox.Show("Parameter cannot be empty.", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }

        private void b_Cancel_Click(object sender, EventArgs e)
        {
            this.DialogResult = DialogResult.Cancel;
            this.Close();
        }
    }
}
